package com.jh.user.business;

import cn.jh.common.exception.ServiceException;
import com.jh.user.pojo.UserAccount;
import com.jh.user.pojo.payment.PaymentProfit;
import com.jh.user.pojo.payment.PosDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.transaction.annotation.Transactional;

import javax.xml.ws.Service;
import java.util.List;
import java.util.Map;


/**
 * @author Fuchun
 * @since 1.0
 */
public interface PaymentProfitBusiness {

    Long addPaymentProfits(List<PosDTO> posList);

    Page<Long> getInitialPaymentProfits(Pageable pageable);

    Long confirmPaymentProfits(Map<Long, Boolean> posIdsToVerifiedMap);

    /**
     * 将可用的分润转至用户帐户中（分页分批执行）。
     *
     * @param pageable 分页参数。
     * @return 返回用户的id。
     */
    Page<Long> syncProfitToAccount(Pageable pageable);

    Page<PaymentProfit> queryBalanceDetails(long userId, Pageable pageable) throws ServiceException;

    void saveUserAccount(UserAccount account);

    UserAccount findUserAccountByUserid(long userId);

    UserAccount findUserId(long userId);
}
